<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="example-5">
    </div>
    <script>
        var a = [1, 2, 3];
        for (item in a) {
            console.log(item)
        }
        console.log(a.valueOf());
        console.log(a.toString());
        a.push(5, 6);
        console.log(a.push());
        console.log(a);
        a.pop();
        console.log(a);
        a.shift();
        console.log(a)
        a.unshift(10)
        console.log(a)
            // console.log(a.join('-'))
        var newa = a.concat({
            name: 'world',
            age: 25
        })
        console.log(newa)
        console.log(a.reverse())
        console.log(a.slice(2, 3))
        var new2 = a.splice(1, 2, 'ni', 'hao')
        console.log(a)
        var b = [5, 2, 1, 10]
        console.log(b.sort(function(ele1, ele2) {
            return ele1 - ele2
        }))
        console.log(b.map(function(n, index) {
            return n * index
        }))
        console.log(b)
        console.log(b.filter(function(n) {
            return n > 5
        }))

        debugger
    </script>
</body>

</html>